/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package drazing;

import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.IOException;
import javax.imageio.ImageIO;

/**
 * Clase que implementa el terreno de fondo
 * @author xcubo
 */
public class Fondo 
{
    private BufferedImage img_src;
    private float width, height;
    private Rectangle2D pattern, lienzo;

    public Fondo(float tamx, float tamy, String type)
    {
        img_src = null;
        width = tamx;
        height = tamy;

        pattern = new Rectangle2D.Double(0,0,100.0,50.0);
        lienzo = new Rectangle2D.Float(0, 0, width, height);


        if (type.equals("grass"))
        {
            try {img_src = ImageIO.read(getClass().getResource("../resources/img/grass.jpg"));}
            catch (IOException e) {}

        }
    }
    public BufferedImage getImage()
    {
        return img_src;
    }

    public Rectangle2D getLienzo()
    {
        return lienzo;
    }
    public Rectangle2D getPattern()
    {
        return pattern;
    }
}
